﻿/**
 * Module: WCF Client Tier
 * 
 * This is a sample code from MSDN, I created this application 
 * just by following the instructions at http://msdn.microsoft.com/en-us/library/ms734712.aspx
 * 
 * This is the Client Tier source code, for detail operations, please
 * the link above and read the detial instructions.
 **/

using System;
using System.Text;
using System.ServiceModel;

namespace Client
{
    class Program
    {
        static void Main(string[] args)
        {
            ServiceRef.CalculatorClient client = new Client.ServiceRef.CalculatorClient();

            double value1 = 100.00d;
            double value2 = 15.99d;
            double result = client.Add(value1, value2);
            Console.WriteLine("Add({0},{1}) = {2}", value1, value2, result);

            value1 = 145.00d;
            value2 = 76.54d;
            result = client.Subtract(value1, value2);
            Console.WriteLine("Subtract({0},{1}) = {2}", value1, value2, result);

            value1 = 9.00d;
            value2 = 81.25d;
            result = client.Multiply(value1, value2);
            Console.WriteLine("Multiply({0},{1}) = {2}", value1, value2, result);

            value1 = 12.00d;
            value2 = 15.99d;
            result = client.Divide(value1, value2);
            Console.WriteLine("Divide({0},{1}) = {2}", value1, value2, result);

            client.Close();
            Console.WriteLine();
            Console.WriteLine("Press <ENTER> to terminate client.");

            Console.ReadLine();
        }
    }
}
